feat: patch ProtoBuf to generate mutable structs#2174
Conversation
|
So I took a much longer look and this won't help. The functions that are generated are just super unwieldy for the big structs like DebugOptions. They generate several mb of IR each. An actual fix would be to not use a static structure but move to some more dynamic handling of those protobufs by making them for example Dicts. I doubt we need the extreme runtime performance that specializing on a message gives you |
|
I did an experiment of turning photo into a separate sub package like ReactantCore. It takes 20 seconds to compile by itself 🥶 |
|
We can do #2175 + make the functionality available via another package (which must be manually loaded). |
|
Converting to a dict is also probably pretty simple. We convert the structs to dicts and then forward the getproperty to the dict |
| field_types = [strip(fm.captures[2]) for fm in field_matches] | ||
|
|
||
| # Build default values dict for getproperty | ||
| defaults_entries = [" :$(fn) => $(get_default_for_type(ft))" for (fn, ft) in zip(field_names, field_types)] |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| defaults_entries = [" :$(fn) => $(get_default_for_type(ft))" for (fn, ft) in zip(field_names, field_types)] | |
| defaults_entries = [ | |
| " :$(fn) => $(get_default_for_type(ft))" for | |
| (fn, ft) in zip(field_names, field_types) | |
| ] |
| args = split_args(args_str) | ||
| if length(args) == num_fields | ||
| # Build keyword constructor call | ||
| kwargs = join(["$(fn)=$(strip(arg))" for (fn, arg) in zip(field_names, args)], ", ") |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| kwargs = join(["$(fn)=$(strip(arg))" for (fn, arg) in zip(field_names, args)], ", ") | |
| kwargs = join( | |
| [ | |
| "$(fn)=$(strip(arg))" for | |
| (fn, arg) in zip(field_names, args) | |
| ], | |
| ", ", | |
| ) |
|
Bump. Reactant precompile time is still atrocious, which also badly affects CI here |
No description provided.